<div class="users view">
    <h2><?php __('User'); ?></h2>
    <dl><?php $i = 0;
$class = ' class="altrow"'; ?>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Id'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
<?php echo $user['User']['id']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
    echo $class; ?>><?php __('Tech Head Name'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
    echo $class; ?>>
            <?php echo $user['User']['username']; ?>
            &nbsp;
        </dd>
        <dt<?php if ($i % 2 == 0)
                echo $class; ?>><?php __('Group'); ?></dt>
        <dd<?php if ($i++ % 2 == 0)
                echo $class; ?>>
    <?php echo $this->Html->link($user['Group']['name'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
            &nbsp;
        </dd>
    </dl>
    <br /> <br /> <br />

    <h3><?php __('Related Timesheets'); ?></h3>
<?php if (!empty($user['Timesheet'])): ?>
        <table cellpadding = "0" cellspacing = "0">
            <tr>
                <th><?php __('Date'); ?></th>
                <th><?php __('Customer Name'); ?></th>
                <th><?php __('Duration'); ?></th>
                <th><?php __('Status'); ?></th>
                <th class="actions"><?php __('Actions'); ?></th>
            </tr>
            <?php
            $i = 0;
            foreach ($user['Timesheet'] as $timesheet):
                $class = null;
                if ($i++ % 2 == 0) {
                    $class = ' class="altrow"';
                }
                ?>
                <tr<?php echo $class; ?>>
                    <td><?php echo $timesheet['date']; ?></td>
                    <td><?php echo $timesheet['customer name']; ?></td>
                    <td><?php $duration = ($timesheet['finish time'] - $timesheet['start time']);
                echo $duration; ?>&nbsp;</td>
                    <td><?php if ($timesheet['status'] == 0) {
                    echo "Not Completed";
                } else
                    echo "Completed"; ?></td>
                    <td class="actions">
        <?php echo $this->Html->link(__('View', true), array('controller' => 'timesheets', 'action' => 'view', $timesheet['id'])); ?>
            <?php echo $this->Html->link(__('Edit', true), array('controller' => 'timesheets', 'action' => 'edit', $timesheet['id'])); ?>
            <?php echo $this->Html->link(__('Delete', true), array('controller' => 'timesheets', 'action' => 'delete', $timesheet['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $timesheet['id'])); ?>
                    </td>
                </tr>
        <?php endforeach; ?>
        </table>
<?php endif; ?>
<?php echo $this->Html->link(__('Back to Tech Head List', true), array('action' => 'index')); ?> &nbsp &nbsp &nbsp &nbsp
<?php echo $this->Html->link(__('Edit Tech Head', true), array('action' => 'edit', $user['User']['id'])); ?> &nbsp &nbsp &nbsp &nbsp
<?php echo $this->Html->link(__('Delete Tech Head', true), array('action' => 'delete', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?> &nbsp &nbsp &nbsp &nbsp
<?php echo $this->Html->link(__('New Timesheet', true), array('controller' => 'timesheets', 'action' => 'add')); ?>


</div>
